package com.settlement.system.controller;

import com.settlement.system.common.constant.StandardConstant;
import com.settlement.system.common.util.RequestContextUtils;
import com.settlement.system.common.util.SecurityUtils;
import com.settlement.system.mapper.security.userdetails.SysUserDetails;
import com.settlement.system.model.entity.common.OrderAuditBillDtlExport;
import com.settlement.system.model.entity.common.SystemUser;
import com.settlement.system.service.IBaseService;
import com.settlement.system.service.IOrderAuditBillDtlExportService;
import com.settlement.system.common.util.common.FasUtil;
import com.settlement.system.common.util.common.SystemUserUtil;
import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import jakarta.annotation.Resource;
import java.util.Map;

/**
 * 订单稽核单据明细导出 前端控制器
 * @author Ximi
 * @since 2020-10-24
 */

@Api(tags = "订单稽核单据明细导出",description = "订单稽核单据明细导出")
@RestController
@RequestMapping("/order/audit/bill/exportDtl")
public class OrderAuditBillDtlExportController extends ExcelController<OrderAuditBillDtlExport> {

    @Resource
    private IOrderAuditBillDtlExportService orderAuditBillDtlExportService;

    @Override
    public IBaseService init() {
        return orderAuditBillDtlExportService;
    }

    @Override
    public Class<?> getModelClass() {
        return OrderAuditBillDtlExport.class;
    }

    @Override
    protected void setParamsModel(Map<String, Object> model) {
        SysUserDetails user = SecurityUtils.getUser();;
        model.put("authorityNo","auth_001");
        model.put("loginName",user.getUsername());
        FasUtil.formatInQueryCondition(model,"spOrderNo","threeLevelChannelNo","orderSourceNo","orderBillStatusNo","companySubject","shopNo","lossReasonNo");
        model.put("orderSourcePermissionList", RequestContextUtils.getHttpSession().getAttribute(StandardConstant.USER_ORDER_SOURCE_PERMISSION));
    }

}

